package org.example.design.observer.test2;

/**
 * @author huangshen
 * @version 0
 * @description 二进制输出类
 * @since 2022/2/11 14:27
 */
public class BinaryObserver extends Observer{

    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println( "二进制 String: "
                + Integer.toBinaryString( subject.getState() ) );
    }
}